<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
		function outer(){
			var x = 0;
			 function inner(){
			 	++x;
			 	console.log(x)
			 }
			 
			 return inner;
			
		}
		
		var inn1 = outer();
		var inn2 = outer();
		inn1();
		inn1();
		inn1();
		inn2();
		inn2();
		inn2();
	</script>
</html>
